package com.myappengine.model;

import java.util.ArrayList;
import java.util.List;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;
import com.google.appengine.datanucleus.annotations.Unowned;

@PersistenceCapable
public class Instructor {
	
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Key key;
	
	@Persistent
	private String instructorId;
	
	@Persistent
	private String instructorName;
	
	@Persistent
	private String diploma;
	
	@Persistent
	@Unowned
	private List<Student> instructedStudents = new ArrayList<Student>();
	
	public Instructor() {
		
	}
	
	public Instructor(String instructorId, String instructorName, String diploma) {
		this.instructorId = instructorId;
		this.instructorName = instructorName;
		this.diploma = diploma;
	}
	
	public Instructor(String instructorId, String instructorName, String diploma, List<Student> instructedStudents) {
		this.instructorId = instructorId;
		this.instructorName = instructorName;
		this.diploma = diploma;
		this.instructedStudents = instructedStudents;
	}

	public List<Student> getInstructedStudents() {
		return instructedStudents;
	}

	public void setInstructedStudents(List<Student> instructedStudents) {
		this.instructedStudents = instructedStudents;
	}

	public String getInstructorId() {
		return instructorId;
	}

	public void setInstructorId(String instructorId) {
		this.instructorId = instructorId;
	}

	public String getInstructorName() {
		return instructorName;
	}

	public void setInstructorName(String instructorName) {
		this.instructorName = instructorName;
	}

	public String getDiploma() {
		return diploma;
	}

	public void setDiploma(String diploma) {
		this.diploma = diploma;
	}

	public Key getKey() {
		return key;
	}
}
